package com.zeratul.cloud.config;

import com.zeratul.common.core.annotation.ExcludeScan;
import com.zeratul.common.core.stype.ServerType;
import com.zeratul.common.core.stype.ServerTypeHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean;

/**
 * 服务类型配置类
 */
@ExcludeScan
@AutoConfiguration(beforeName = {
        "com.zeratul.web.config.ServerAutoConfiguration",
        "com.zeratul.reactor.config.ServerAutoConfiguration"
})
@Slf4j
public class ServerAutoConfiguration {

    /**
     * 微服务
     * @return
     */
    @Bean
    public ServerTypeHandler monoLithicHandler() {
        log.info("当前服务类型：{}", ServerType.MICROSERVICE.getName());
        return () -> ServerType.MICROSERVICE;
    }
}
